package com.che.software.testato.domain.entity;

import java.io.Serializable;

import com.che.software.testato.domain.enumeration.AssignmentStatus;
import com.che.software.testato.domain.enumeration.CriterionTypes;
import com.che.software.testato.domain.enumeration.SelectionTypes;
import com.che.software.testato.util.jsf.faces.LocaleUtil;

/**
 * Class representing an iteration.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class Iteration implements Serializable {

	/**
	 * Constants.
	 */
	private static final long serialVersionUID = -3902733985231307718L;

	/**
	 * Members.
	 */
	private AssignmentStatus analyticalStatus, selectiveStatus;
	private CriterionTypes criterionType;
	private Double consistencyIndex;
	private Integer iterationId, iterationAssignmentId, serviceId, versionId;
	private Project project;
	private SelectionTypes selectionType;
	private Service service;
	private String analyticalStringStatus, criterionStringType, selectionStringType, selectiveStringStatus;
	private Version version;

	/**
	 * Getter for the translation of the analyticalStatus field.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @return the translated value to display.
	 * @since July, 2011.
	 */
	public String getAnalyticalStatusTranslation() {
		return LocaleUtil.getAssignmentStatusTranslation(getAnalyticalStatus());
	}

	/**
	 * Getter for the translation of the criterionType field.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @return the translated value to display.
	 * @since July, 2011.
	 */
	public String getCriterionTypeTranslation() {
		return LocaleUtil.getCriterionTypeTranslation(getCriterionType());
	}

	/**
	 * Getter for the translation of the selectionType field.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @return the translated value to display.
	 * @since July, 2011.
	 */
	public String getSelectionTypeTranslation() {
		return LocaleUtil.getSelectionTranslation(getSelectionType());
	}

	/**
	 * Getter for the translation of the selectiveStatus field.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @return the translated value to display.
	 * @since July, 2011.
	 */
	public String getSelectiveStatusTranslation() {
		return LocaleUtil.getAssignmentStatusTranslation(getSelectiveStatus());
	}

	/**
	 * Getter for the private field value analyticalStatus.
	 * 
	 * @return the analyticalStatus field value.
	 */
	public AssignmentStatus getAnalyticalStatus() {
		return (null != analyticalStringStatus && !"".equals(analyticalStringStatus)) ? AssignmentStatus.valueOf(analyticalStringStatus) : analyticalStatus;
	}

	/**
	 * Getter for the private field value selectiveStatus.
	 * 
	 * @return the selectiveStatus field value.
	 */
	public AssignmentStatus getSelectiveStatus() {
		return (null != selectiveStringStatus && !"".equals(selectiveStringStatus)) ? AssignmentStatus.valueOf(selectiveStringStatus) : selectiveStatus;
	}

	/**
	 * Getter for the private field value criterionType.
	 * 
	 * @return the criterionType field value.
	 */
	public CriterionTypes getCriterionType() {
		return (null != criterionStringType && !"".equals(criterionStringType)) ? CriterionTypes.valueOf(criterionStringType) : criterionType;
	}

	/**
	 * Getter for the private field value consistencyIndex.
	 * 
	 * @return the consistencyIndex field value.
	 */
	public Double getConsistencyIndex() {
		return consistencyIndex;
	}

	/**
	 * Setting a value to the consistencyIndex field.
	 * 
	 * @param consistencyIndex the value to set.
	 */
	public void setConsistencyIndex(Double consistencyIndex) {
		this.consistencyIndex = consistencyIndex;
	}

	/**
	 * Getter for the private field value iterationId.
	 * 
	 * @return the iterationId field value.
	 */
	public Integer getIterationId() {
		return iterationId;
	}

	/**
	 * Setting a value to the iterationId field.
	 * 
	 * @param iterationId the value to set.
	 */
	public void setIterationId(Integer iterationId) {
		this.iterationId = iterationId;
	}

	/**
	 * Getter for the private field value serviceId.
	 * 
	 * @return the serviceId field value.
	 */
	public Integer getServiceId() {
		return serviceId;
	}

	/**
	 * Setting a value to the serviceId field.
	 * 
	 * @param serviceId the value to set.
	 */
	public void setServiceId(Integer serviceId) {
		this.serviceId = serviceId;
	}

	/**
	 * Getter for the private field value selectionType.
	 * 
	 * @return the selectionType field value.
	 */
	public SelectionTypes getSelectionType() {
		return (null != selectionStringType && !"".equals(selectionStringType)) ? SelectionTypes.valueOf(selectionStringType) : selectionType;
	}

	/**
	 * Getter for the private field value service.
	 * 
	 * @return the service field value.
	 */
	public Service getService() {
		return service;
	}

	/**
	 * Setting a value to the service field.
	 * 
	 * @param service the value to set.
	 */
	public void setService(Service service) {
		this.service = service;
	}

	/**
	 * Setting a value to the analyticalStatus field.
	 * 
	 * @param analyticalStatus the value to set.
	 */
	public void setAnalyticalStatus(AssignmentStatus analyticalStatus) {
		this.analyticalStatus = analyticalStatus;
	}

	/**
	 * Setting a value to the selectiveStatus field.
	 * 
	 * @param selectiveStatus the value to set.
	 */
	public void setSelectiveStatus(AssignmentStatus selectiveStatus) {
		this.selectiveStatus = selectiveStatus;
	}

	/**
	 * Setting a value to the criterionType field.
	 * 
	 * @param criterionType the value to set.
	 */
	public void setCriterionType(CriterionTypes criterionType) {
		this.criterionType = criterionType;
	}

	/**
	 * Setting a value to the selectionType field.
	 * 
	 * @param selectionType the value to set.
	 */
	public void setSelectionType(SelectionTypes selectionType) {
		this.selectionType = selectionType;
	}

	/**
	 * Setting a value to the analyticalStringStatus field.
	 * 
	 * @param analyticalStringStatus the value to set.
	 */
	public void setAnalyticalStringStatus(String analyticalStringStatus) {
		this.analyticalStringStatus = analyticalStringStatus;
	}

	/**
	 * Setting a value to the criterionStringType field.
	 * 
	 * @param criterionStringType the value to set.
	 */
	public void setCriterionStringType(String criterionStringType) {
		this.criterionStringType = criterionStringType;
	}

	/**
	 * Setting a value to the selectionStringType field.
	 * 
	 * @param selectionStringType the value to set.
	 */
	public void setSelectionStringType(String selectionStringType) {
		this.selectionStringType = selectionStringType;
	}

	/**
	 * Setting a value to the selectiveStringStatus field.
	 * 
	 * @param selectiveStringStatus the value to set.
	 */
	public void setSelectiveStringStatus(String selectiveStringStatus) {
		this.selectiveStringStatus = selectiveStringStatus;
	}

	/**
	 * Getter for the private field value iterationAssignmentId.
	 * 
	 * @return the iterationAssignmentId field value.
	 */
	public Integer getIterationAssignmentId() {
		return iterationAssignmentId;
	}

	/**
	 * Setting a value to the iterationAssignmentId field.
	 * 
	 * @param iterationAssignmentId the value to set.
	 */
	public void setIterationAssignmentId(Integer iterationAssignmentId) {
		this.iterationAssignmentId = iterationAssignmentId;
	}

	/**
	 * Getter for the private field value versionId.
	 * 
	 * @return the versionId field value.
	 */
	public Integer getVersionId() {
		return versionId;
	}

	/**
	 * Setting a value to the versionId field.
	 * 
	 * @param versionId the value to set.
	 */
	public void setVersionId(Integer versionId) {
		this.versionId = versionId;
	}

	/**
	 * Getter for the private field value project.
	 * 
	 * @return the project field value.
	 */
	public Project getProject() {
		return project;
	}

	/**
	 * Setting a value to the project field.
	 * 
	 * @param project the value to set.
	 */
	public void setProject(Project project) {
		this.project = project;
	}

	/**
	 * Getter for the private field value version.
	 * 
	 * @return the version field value.
	 */
	public Version getVersion() {
		return version;
	}

	/**
	 * Setting a value to the version field.
	 * 
	 * @param version the value to set.
	 */
	public void setVersion(Version version) {
		this.version = version;
	}
}